package events;

import org.eclipse.swt.events.MouseAdapter;

/**
 * Class intended to be inherit from those classes inside the Dust project that
 * needs handle MouseEvents. This class just add a few methods that wraps some
 * logic for frequently asked questions. For example it has a isLeftClick() and
 * isRightClick() methods, that seems that could be quite useful. In fact, I
 * don't know why SWT MouseListener doesn't implements these methods!.
 * 
 * @author ole
 */
public abstract class DustMouseListener extends MouseAdapter {
	/**
	 * Method that checks if the click is a left-button click.
	 * 
	 * @return
	 * 		True if the click was with the left button.
	 */
	protected boolean isLeftClick(int button) {
		if (button == 1)
			return true;
		return false;
	}
	
	/**
	 * Method that checks if the click is a right-button click.
	 * 
	 * @return
	 * 		True if the click was with the right button.
	 */
	protected boolean isRightClick(int button) {
		if (button == 3)
			return true;
		return false;
	}
}
